# 题目2

def check(func):
    def inner(*args, **kwargs):
        res = func(*args, **kwargs)
        name, age = res
        my_dict = {"name":name,"age":age}
        my_json = '%s' % my_dict
        return my_json
    return inner

class Get_Json():
    def __init__(self,func):
        self.func = func

    def __call__(self, *args, **kwargs):
        rst = self.func()
        json_str = '{"name":%s,"age":%d}'% rst
        return json_str


# @check
@Get_Json
def get_info():
    name = "itcast"
    age = 18
    return (name,age)

print(get_info())
print(type(get_info()))
